package com.yan.yjhTest.designPattern.factoryMethod.demo01;


import com.yan.yjhTest.designPattern.factoryMethod.demo01.abstractFactory.AbstractHumanFactory;

public class HumanFactory extends AbstractHumanFactory {

	@Override
	public <T extends Human> T createHuman(Class<T> c) {
		Human human = null;//定义一个生产的人种
		try {
			//产生一个人种
			human = (T)Class.forName(c.getName()).newInstance();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return (T) human;
	}

}
